/*
 * @Description: 设施分组管理
 */
import zhreq from "@/api/axios";
export default {
  /**
   * @description: 获取所拥有设施分组列表
   * @param {String/Number} page
   * @param {String/Number} size
   */
  queryPageByCondition(params) {
    return zhreq.post('v3/facility/facilityControlGroup/queryPageByCondition', params)
  },
  /**
   * @description: 添加设施分组
   * @param {Object}  *
   */
  add(params) {
    return zhreq.post('v3/facility/facilityControlGroup/add', {
      ...params,
      farmingTypeNo: sessionStorage.farmingTypeNo,
      organizationNo: sessionStorage.organizationNo,
    });
  },
  /**
   * @description: 修改设施分组
   * @param {Object}  *
   */
  edit(params) {
    return zhreq.post('v3/facility/facilityControlGroup/edit', {
      ...params,
      farmingTypeNo: sessionStorage.farmingTypeNo,
      organizationNo: sessionStorage.organizationNo,
    });
  },
  /**
   * @description: 删除设施分组
   * @param {Object}  *
   */
  delByNo(no) {
    return zhreq.get(`/v3/facility/facilityControlGroup/delByNo?no=${no}`);
  },
  /**
   * @description: 批量删除设施分组
   * @param {Object}  *
   */
  delList(params) {
    return zhreq.post('/v3/facility/facilityControlGroup/delListByNo', {
      ...params,
      farmingTypeNo: sessionStorage.farmingTypeNo,
      organizationNo: sessionStorage.organizationNo,
    });
  },
  /**
   * @description: 获取设施组
   * @param {String} organizationtId
   * @return {Array}
   */
  queryFGByFtNo(param) {
    return zhreq.post("/v3/facility/facility/queryFGByFtNo", {
      ...param,
      organizationList: sessionStorage.getItem("organizationList").split(","),
      farmingTypeNo: sessionStorage.getItem("farmingTypeNo"),
      facilityCategoryId: 1,
    });
  },
  /**
   * @description: 主键查询设施组信息
   * @param {String} facilityId *
   * @return {Object}
   */
  queryFacilityGroup(no) {
    return zhreq.get(`/v3/facility/facilityControlGroup/queryFacilityDetailsByGroupNo?no=${no}`);
  },
};
